<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>{$title}</h2>
  </div>
  <form action="{:U('addGrade')}" method="post" class="form-horizontal">
    <div class="form-item">
      <label class="item-label">等级名称</label>
      <div class="controls">
        <input type="text" class="text input-large" name="name" <eq name="data.id" value="1"> disabled </eq> value="{$data.name|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">商品数量<span class="check-tips">（允许发布的商品数量）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="goods_limit" value="{$data.goods_limit}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">图片数量<span class="check-tips">（允许上传图片数量）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="album_limit" value="{$data.album_limit}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">价格<span class="check-tips">（店铺等级的费用）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="price" value="{$data.price|default='0.00'}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">等级说明</label>
      <div class="controls">
        <label class="textarea input-large">
        <textarea name="description">{$data.description|default=''}</textarea>
        </label>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">等级<span class="check-tips">（越大等级越高）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" <eq name="data.id" value="1"> disabled </eq> name="sort" value="{$data.sort|default='0'}">
      </div>
    </div>
    <!-- 新增店铺可拥有活动权限 -->
    <div class="form-item">
      <label class="item-label">营销活动权限<span class="check-tips">（店铺等级不同，可使用营销活动权限不同）</span></label>
        <div class="controls">
          <volist name="list" id="val" key="key">
              <input type="checkbox" name="marketing[]" value="{$key-1}" <?php if(in_array($key-1,$data['marketing'])){?>checked<?php }?> />{$val}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          </volist>
        </div>
    </div>

    <div class="form-item">
      <input type="hidden" name="id" value="{$data.id|default=''}">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>
<block name="script">
  <script type="text/javascript">
    //导航高亮
    highlight_subnav('{:U('Store/grade')}');
  </script>
</block>
